<template>
   <div class="login-box">

     <el-card>
       <el-form label-width="60px">

         <el-form-item>
              xx管理系统-登录
         </el-form-item>

         <el-form-item label="用户名">
           <el-input v-model="user.username"></el-input>
         </el-form-item>
         <el-form-item label="密码">
           <el-input v-model="user.password"></el-input>
         </el-form-item>

         <el-form-item >
           <el-button type="success" @click="btnLoginClick">登录</el-button>
         </el-form-item>
       </el-form>
     </el-card>



   </div>
</template>

<script>
export default {
  name: "Login",
  data(){
    return {
        user:{
           username:'',
           password:''
        }
    }

  }, methods:{

      btnLoginClick(){
          this.axios({ //ajax 请求
             url:'http://test.org/emp/login',
             method:'get',
             dataType:'json'
          }).then((res)=>{
              if(res.data.success==true){
                  this.$router.push('/layout');
              }

          })
      }

  }
}
</script>

<style scoped>

.login-box{


    width: 500px;
    margin-left: 600px;
    margin-top: 450px;

}

</style>